/**
 * 
 */
package com.hezhi.framework.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author wudo
 *
 */
public class DateUtil {
	
	/**
	 * 
	 * @param date
	 * @param format
	 * @return
	 */
	public static String dateFormatter(Date date, String format)
	{
		String formatString = null;
		try
		{
			SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
			if (date != null)
			{
				formatString = simpleDateFormat.format(date);
			}
			else
			{
				System.err.println(" DateUtil :: dateFormatter :: The Date is null !! ");
				formatString = "";
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		return formatString;

	}

}
